<% includeFileTemplate("../_header.html"){} %>

<body>
 <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">管理平台</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="${request.ContextPath}/adminmg/">首页</a></li>
            <li class="active"><a href="${request.ContextPath}/adminmg/loginout">退出</a></li>
            <li class="active"><a href="${request.ContextPath}/adminmg/password">修改密码</a></li>
            <li class="active"><a href="${request.ContextPath}">返回前台</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>

<div class="container" >
<div style="margin: 80px;"></div>

<form class="form" id="formID" >
  <div class="form-group">
    <input type="password" class="form-control" placeholder=" 输入原密码" name="pass">
  </div>
  <div class="form-group">
   <input type="password" class="form-control" placeholder=" 输入新密码" name="password">
  </div>
  <button type="button" id="sub" class="btn btn-default"> 立即修改 </button>
</form>

</div>

</body>
<% includeFileTemplate("../_footer.html"){} %>
<script type="text/javascript">
$(function() {
	$("#sub").bind("click",function(){
		var urlPost="${request.ContextPath}/adminmg/dopassword";
		$.ajax({
			type:"POST",
			url:urlPost,
			data:$("#formID").serialize(),
			success:function(data){
				console.info(data);
				if(data.statusCode == 200){
					alert(data.message);
					location.href=location.href;
				}else{
					alert(data.message);
				}
			},
			error:function(data){
				console.info(data);
			}
		})
	})
});
</script>
</html>